// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start () {
        cc.tween(this.node)
            .to(5, {position: cc.v3(-1200, 0, 0)})
            .call(() => {
                this.node.x = 600;
            })
            .union() // 将上面的action合并为一个队列
            .repeatForever() // 一直重复
            .start()
    }

    // update (dt) {}
}
